package cn.assumejson.springframework.aop;

import java.lang.reflect.Method;

/**
 * @author gang.Li
 * @version 1.0
 * @since 1.0 2021/12/9 22:08
 */
public interface IntroductionAwareMethodMatcher extends MethodMatcher {

    /**
     * Perform static checking whether the given method matches. This may be invoked
     * instead of the 2-arg {@link #matches(java.lang.reflect.Method, Class)} method
     * if the caller supports the extended IntroductionAwareMethodMatcher interface.
     *
     * @param method           the candidate method
     * @param targetClass      the target class
     * @param hasIntroductions {@code true} if the object on whose behalf we are
     *                         asking is the subject on one or more introductions; {@code false} otherwise
     * @return whether or not this method matches statically
     */
    boolean matches(Method method, Class<?> targetClass, boolean hasIntroductions);
}
